package com.yss.netty.processor;

import com.yss.netty.protocol.CommandType;
import com.yss.netty.protocol.SerType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessorResultInfo {

    private SerType serType;

    private CommandType commandType;

    private Object handleResult;

    public ProcessorResultInfo of(final CommandType commandType, final Object handleResult) {
        return ProcessorResultInfo.builder().serType(SerType.JSON).commandType(commandType).handleResult(handleResult).build();
    }

    public ProcessorResultInfo of(final SerType serType, final CommandType commandType, final Object handleResult) {
        return ProcessorResultInfo.builder().serType(serType).commandType(commandType).handleResult(handleResult).build();
    }

}
